// 前端应用程序的入口文件，尤其是在使用现代 JavaScript 框架（如 Vue.js、React 或 Angular）构建单页应用程序（SPA）时
// 负责初始化应用程序，导入所需的库和模块，并设置应用程序的根组件

import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
// Vue.config.productionTip = false;
// element-ui
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css';
// 公共样式
import './assets/css/common.scss'
// 阿里矢量图
import "./assets/icon/iconfont.js"
import "./assets/icon/iconfont.css"
// 公共方法
// import './plugin/common.js'
// 时间格式转化
import DateUtil from './utils/date'
Vue.prototype.$DateUtil = DateUtil
// 树形数据处理
import TreeUtil from './utils/tree'
Vue.prototype.$TreeUtil = TreeUtil
// wps
import wps from './utils/wps-ext'
Vue.prototype.$Wps = wps
// http
import http from './request/http'
Vue.prototype.$http = http

//引入moment
import * as moment from 'moment'
Vue.prototype.$moment = moment

Vue.use(ElementUI)
import actions from './action.js'

import { registerMicroApps, start } from 'qiankun'
let apps = [];
window.microApp.forEach(app => {
  const { key, name, url } = app
  apps.push(
    {
      name: name,
      entry: url,
      container: '#appCotainer',
      activeRule: key,
      props: {
        app,
        actions
      }
    }
  );
})
const config = {
  beforeLoad: [
    app => {
    }
  ], // 挂载前回调
  beforeMount: [
    app => {
    }
  ], // 挂载后回调
  afterUnmount: [
    app => {
    }
  ] // 卸载后回调
}
registerMicroApps(apps, config);
start();

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
